﻿using System;
using System.Diagnostics;
using System.Text;

namespace Catchbase.Service.API
{
    public class RequestBuilder
    {
        private readonly HttpRequestGatewayFactory _httpRequestGatewayFactory;

        protected RequestBuilder()
        {
            
        }

        public RequestBuilder(HttpRequestGatewayFactory httpRequestGatewayFactory)
        {
            _httpRequestGatewayFactory = httpRequestGatewayFactory;
        }

        public virtual HttpWebRequestGateway Build(HttpMethod method, Uri uri)
        {
            Debug.Assert(uri != null);
            var request =  _httpRequestGatewayFactory.Create(uri);
            request.Method = method.ToString();
            request.ContentType = "application/json; charset=utf-8";
            return request;
        }


    }
}